package com.ccsoft.leetcode.service;

import org.springframework.stereotype.Service;

/**
 * 7. 整数反转
 * 2021年11月2日 15:47:52 未成功
 */
@Service
public class ReverseInteger {

    public int go(int x){
        Integer a = x;
        String str = a.toString();
        String reverseString = new StringBuffer(str).reverse().toString();
        Integer reInteger = null;
        try{
            reInteger = Integer.parseInt(reverseString);
        }catch (Exception e){
            return 0;
        }

        return reInteger.intValue();
    }

    public Integer get1(int x) {
         Integer a = x;
        return a;
    }
}
